/*	CodeEval[Easy]::SimpleSorting
 *	Print sorted numbers from least to greatest (left to right)
 *	Program should accept as its first argument a path to filename
 *
 *	Solution by Michael Pio Arroyo
 */

#include <iostream>
#include <stdio.h>
#include <fstream>
#include <string>
#include <vector>

void Sort(std::vector<float> &v);

int main(int argc, char** argv) {
	std::ifstream file;
	std::string line;
	std::string::iterator it;
	file.open(argv[1]);
	while (std::getline(file, line)) {
		std::vector<float> n;
		std::string s;
		for (it = line.begin(); it != line.end(); ++it){
			std::string t;
			if (*it != ' ') {
//				std::cout << *it;
				t = *it;
				s.append(t.c_str());
			}
			else {
//				std::cout << ' ';
				n.push_back(atof(s.c_str()));
				s.clear();
			}
		}
		n.push_back(atof(s.c_str()));
		s.clear();
//		std::cout << '\n';
//		size_t size = n.size();
//		for (int i = 0; i < size; ++i) {
//			std::cout << n.at(i) << ' ';
//		}
//		std::cout << '\n';

		// sort
		Sort(n);
	}

	file.close();
	return 0;
}

void Sort(std::vector<float> &v) {
	float t = 0.0;
	size_t size = v.size();

	for (int i = 0; i < size; ++i) {
		for (int j = 0; j < size - 1; ++j) {
			if (v.at(j) > v.at(j + 1)) {
				t = v.at(j);
				v.at(j) = v.at(j + 1);
				v.at(j + 1) = t;
			}
		}
	}
	
	for (int i = 0; i < size; ++i) {
		std::cout << v.at(i) << ' ';
	}
	std::cout << '\n';
}